<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateApp extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('app_basic', function(Blueprint $table){
            $table->increments('id');
            $table->string('name', 20);
            $table->string('app_key');
            $table->string('app_secret');
            $table->string('code')->nullable();
            $table->string('access_token')->nullable();
            $table->timestamp('authorize_time')->nullable();
            $table->timestamp('expire_time')->nullable();
            $table->string('refresh_token')->nullable();
            $table->text('backup')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('app_basic');
    }
}
